/**
 * @Author: panda
 * @Date: 2022-05-18 10:44
 * @Description: 搜索
 */
import type {AppRouteModule} from '@/router/types';

const search: AppRouteModule = {
  path: '/search',
  name: 'search',
  component: () => import('@/views/search/SearchView.vue'),
  meta: {
    title: '搜索'
  },
  children: [
    {
      path: '/search/:type',
      name: 'searchVideo',
      component: () => import('@/views/search/searchResultView.vue'),
      meta: {
        title: '视频搜索结果'
      },
      // 声明路由接收query请求参数
      props: (route: any) => ({keyword: route.query.keyword})
      // props (route) {
      //   return {
      //     keyword: route.query.keyword
      //   }
      // }
    }
    /* {
              path: '/search/article',
              name: 'searchArticle',
              component: import("@/views/search/searchArticleView.vue"),
              meta: {
                  title: '文章搜索结果'
              }
          } */
  ]
}


export default search;
